package login

import (
	"context"
	v1 "donkey-admin/api/apis/v1"
	"donkey-admin/internal/dao"
	"donkey-admin/internal/model/do"
	"github.com/google/uuid"
)

func (s *sApi) ApisAdd(ctx context.Context, req *v1.ApiAddReq) (res *v1.ApiAddRes, err error) {

	_, err = dao.SysApis.Ctx(ctx).Insert(&do.SysApis{
		Uuid:      uuid.New().String(),
		ApiPath:   req.ApiPath,
		ApiMethod: req.ApiMethod,
		ApiInfo:   req.ApiInfo,
		ApiGroup:  req.ApiGroup,
	})
	if err != nil {
		return nil, err
	}

	return &v1.ApiAddRes{}, nil
}
